import ContentItem from '../ContentItem'
import st from './item.module.css'
import { useNavigate } from 'react-router'

// card卡片
const MainItem = ({ title, config, xNum, src, scroll = false, row = 1, dir = false }: any) => {
    const navigate = useNavigate()

    return <div className={st.item} onClick={title === '会员关怀' ? () => navigate('/vipbirthlist') : () => { }}>
        <div className={st.title}>
            <img src={src} alt="" />
            <span>{title}</span>
        </div>
        <div className={`${scroll ? st.scrollContent : st.content} ${dir ? st.jcs : st.jcc}`} >
            <ContentItem config={config} xNum={xNum} scroll={scroll} row={row} dir={dir} />
        </div>
    </div>
}
export default MainItem